<div class='span12'>
    <!-- HEADER -->
    <div class='row-fluid'>
        <div class='span12'>
            <div class='page-header'>
                <h1>
                    <i class='icon-cogs'></i>
                    <span><?= $MODULE; ?></span>
                </h1>
            </div>
        </div>
    </div>

    <!-- END OF HEADER -->


    <div class="row-fluid">
        <div class="span12 box bordered-box blue-border">
            <div class="box-header dark-background">
                <div class="title"><?= $TITLE; ?></div>
                <div class="actions">
                    <a href="#" class="btn box-remove btn-mini btn-link"><i class="icon-remove"></i>
                    </a>
                    <a href="#" class="btn box-collapse btn-mini btn-link"><i></i>
                    </a>
                </div>
            </div>

            <div class="box-content">
                <p>
                    <small><?= $DESCRIPTION; ?></small>
                    <a class="btn btn-info pull-right" href="<?= URL::to("admin/user");?>"> User List </a>
                </p>


                
                <p><small class="pull-right text text-error">All fields are mandatory</small></p>
<hr>
                <form accept-charset="<?= Settings::get('en','charecter_set');?>" action="<?= URL::current(); ?>" class="form form-horizontal "
                      method="post">

                    <div>
                        <?= Form::token(); ?>
                    </div>

                    <?php if(Session::get('message')){?>
                    <p>
                        <?=
                        (Session::get('message') ? Session::get('message') : '');
                        ?>
                       
                    </p>
                    <?php }?>


                    <div class="control-group">
                        <label class="control-label"><i class="icon-user"></i> User ID </label>

                        <div class="controls">
                            <input class="input-xlarge" name="userid"
                                   value="<?= $user['info']->username;?>" placeholder="UserID"
                                   type="text" >
                          	<span class="text text-error"><?php echo $errors->first('userid') ?></span>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">Name </label>

                        <div class="controls">
                            <input class="input-xxlarge" name="name"
                                   value="<?= $user['info']->name;?>" placeholder="Full name..."
                                   type="text">
                            <span class="text text-error"><?= $errors->first('name')?></span>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">Email </label>

                        <div class="controls">
                            <input class="input-xxlarge" name="email"
                                   value="<?= $user['info']->email;?>" placeholder="Email"
                                   type="text">
                            <span class="text text-error"><?= $errors->first('email')?></span>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">Role </label>

                        <div class="controls">
                            <select name="role_id">
                                <option value="" selected="selected">--Select--</option>
                                <?php foreach ($roles as $roles): ?>
                                    <option value="<?= $roles->id; ?>" <?php if($roles->id == $user['info']->role_id) echo "Selected='selected'";?>"><?= $roles->name; ?></option>
                                <?php endforeach; ?>
                            </select>
                            <span class="text text-error"><?= $errors->first('role_id')?></span>
                        </div>
                    </div>

                    <hr class="hr-normal">
                    <div class="control-group">
                        <label class="control-label">Password </label>

                        <div class="controls">
                            <input class="input-xlarge" name="password"
                                   placeholder="Password"
                                   type="password">
                            <span class="text text-error"><?= $errors->first('password')?></span>
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label">Repeat</label>

                        <div class="controls">
                            <input class="input-xlarge" name="password_confirm"
                                   placeholder="Repeat Password"
                                   type="password">
                            <span class="text text-error"><?= $errors->first('password_confirm')?></span>
                        </div>
                    </div>
                    
                     <hr class="hr-normal">
                    <div class="control-group">
                        <label class="control-label">Active</label>

                        <div class="controls">
                            <label class="radio inline">
                                <input type="radio" value="51" name="user_status" <?php if($user['info']->status =="51") echo "Checked='checked'";?>>
                                Yes
                            </label>
                            <label class="radio inline">
                                <input type="radio" value="1" name="user_status" <?php if($user['info']->status == "1") echo "Checked='checked'";?>>
                                No
                            </label>

                        </div>
                    </div>

                    <hr class="hr-normal">


                    <div class="form-actions">
                    <input type="hidden" name="id" id="id" value="<?= $user['info']->id;?>">
                        <button class="btn btn-primary" type="submit" name="btnSave" value="save"  <?php if(Config::get('application.mode')){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" 
                                        <?}else{?>onclick="return confirm('Are you sure ?');"<?php }?>>
                            <i class="icon-save"></i>
                            Save
                        </button>

                    </div>
                </form>


            </div>
        </div>
    </div>


    <!-- END OF CONTENT -->
</div>
